package com.smartHome.controller;

import com.smartHome.pojo.entity.Result;
import com.smartHome.utils.AliOssUtil;
import com.smartHome.utils.UploadUtil;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;


import java.io.IOException;
import java.util.UUID;

@RestController
public class FileUploadController {


    @PostMapping("/upload")
    public Result<String> upImg(MultipartFile file) throws IOException {
        return Result.success(UploadUtil.uploadImage(file));
    }
}
